package com.zyh.work3

object WorkTest6 {
  def main(args: Array[String]): Unit = {
    var map: Map[String,String] = Map()
    map += "Tom" -> "CoreJava"
    map += "John" -> "Oracle"
    map += "Susan" -> "Oracle"
    map += "Jerry" -> "JDBC"
    map += "Jim" -> "Unix"
    map += "Kevin" -> "JSP"
    map += "Lucy" -> "JSP"
    map = map.updated("Lucy","CoreJava")
    for((k,v) <- map if v.equals("JSP")) println(k)
    var javaCount = 0
    var jdbcCount = 0
    for((k,v) <- map ) {
      v match {
        case "CoreJava" => javaCount+=1
        case "JDBC" => jdbcCount+=1
        case _ =>
      }
    }
    println(s"javaCount,jdbcCount = ${javaCount},${jdbcCount}")
  }
}
